package com.sichen.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 处理页面跳转请求
 * <p>Created with IntelliJ IDEA.
 * <p>Author: 思尘
 * <p>Created time: 2022-09-20 20:27
 * <p>Version: V1.0
 */
@Configuration
public class MyWebConfig implements WebMvcConfigurer {

    /**
     * 发送一个请求直接跳转到一个页面
     * Spring MVC viewController : 将请求和页面映射过来
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
